import { ADQContaniner } from "../DesignMode/ADQContaniner";
import { VMUtil } from "../MVVM/VMUtil";
import { Dictionary } from "../Common/Dictionary";
import ProgressManager from "../Core/ProgressManager";
import GlobalConfig from "./GlobalConfig";
import { IADQContaniner, IRegisterMoudle } from "../Interfaces/IIOC";
import CacheUtil from "./CacheUtil";
import { DataFactory } from "../Implements/ImpUtils/DataFactory";
import { StateMachine } from "../Implements/ImpStateMachine/StateMachine";
import { StateMachineManager } from "../Implements/ImpStateMachine/StateMachineManager";
import { DataChangeTool } from "../Implements/ImpUtils/DataChangeTool";
/**ADQ框架IOC 组件注册 */
export default class LoadADQMoudle implements IRegisterMoudle {
  Load(container: IADQContaniner): void {
    container.Register("IADContaniner", ADQContaniner).SingleInstance();
    container.Register("IDataFactory", DataFactory).SingleInstance();
    container.Register("IStateMachine", StateMachine);
    container.Register("IStateMachineManager", StateMachineManager);
    container.Register("IVMUtil", VMUtil);
    container.Register("IDictionary", Dictionary);
    container.Register("IProgressManager", ProgressManager);
    container.Register("IGlobalConfig", GlobalConfig).SingleInstance();
    container.Register("IDataChangeTool", DataChangeTool).SingleInstance();
    container.Register("ICache", CacheUtil).SingleInstance();

    //读取类示例
    // var data2 = IOC.instance.Resolve("IADContaniner");
    //读取函数示例 构造函数示例
    //var func = IOC.instance.ResolveToFunc("IADContaniner");
    //var cst=new func.prototype.constructor("s","x");//构造函数传参
  }
}
